package com.madzone.gae.filem.model;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Unique;

import com.google.appengine.api.datastore.Key;
import com.madzone.wiki.gae.ds.model.PMF;

@PersistenceCapable
@Inheritance(strategy=InheritanceStrategy.SUBCLASS_TABLE)
public abstract class File<T> {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Unique
	@Persistent
	private String fileName;
	
	public File(String fileName) {
		this.fileName = fileName;
	}
	
	public File() {
	}

	public Key getKey() {
		return key;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public abstract T getContent();

	public abstract void setContent(T content);
	
	public abstract byte[] getContentBytes();
	
	public abstract void setContentBytes(byte[] contentBytes);

}
